package me.ydq.misc;

import org.springframework.lang.NonNull;

import java.util.Iterator;
import java.util.List;
import java.util.stream.Stream;


public record PageData<T>(List<T> list, Integer total) implements Iterable<T> {


    public Stream<T> stream() {
        return list.stream();
    }

    public Stream<T> parallelStream() {
        return list.parallelStream();
    }

    public boolean isEmpty() {
        return list.isEmpty();
    }

    public int size() {
        return list.size();
    }

    @Override
    public @NonNull Iterator<T> iterator() {
        return list.iterator();
    }

}
